﻿using System;
using System.IO;

namespace ResourceReportBuilder
{
    public class FileSystemDetailEventArgs : EventArgs
    {
        public string Path { get; private set; }
        public string Name { get; private set; }

        public FileSystemDetailEventArgs(string path)
        {
            Path = path;
            if (File.Exists(path))
            {
                Name = System.IO.Path.GetFileName(path);
            }
            else if (Directory.Exists(path))
            {
                Name = System.IO.Path.GetDirectoryName(path);
            }
            else
            {
                throw new IOException("Invalid path.");
            }
        }
    }
}
